// console.log("webpack")
// const root = document.getElementById("root")
// root.textContent = "webpack2"

// import React from "react"
// import ReactDOM from "react-dom"
// export default function App() {
//     return (
//         <div>
//             <h2>我是react</h2>
//         </div>
//     )
// }
//
// const root = document.getElementById("root")
// ReactDOM.render(<App />, root)

import React from "react";
import ReactDOM from "react-dom";
import Home from "./view/Home.tsx";
// import Left from "./comptents/Left.tsx";
import MyButton from "./comptents/MyButton.js";
import Bottom from "./comptents/Bottom.tsx";
import AboutPage from "./comptents/AboutPage.tsx";
import PageList from "./comptents/PageList.tsx";

let content;
let isLoggedIn = false;
if (isLoggedIn) {
  content = <AboutPage />;
} else {
  content = <MyButton />;
}
// {
//   isLoggedIn ? <AdminPanel /> : <LoginForm />; //使用 条件 ? 运算符。与 if 不同的是，它工作于 JSX 内部
// }
export default function App() {
  return (
    <div className="box-con">
      <Home />
      <MyButton />
      <AboutPage />
      <Bottom />
      {!isLoggedIn && <MyButton />}
      <PageList />
    </div>
  );
}

const root = document.getElementById("root");
ReactDOM.render(<App />, root);
